//package com.heipi.myjavademo.布隆过滤器;
//import org.apache.commons.lang3.StringUtils;
//import org.apache.commons.collections4.BloomFilter;
//import org.apache.commons.collections4.functors.HashFunctionIdentity;
///**
// * @author: honry.guan
// * @create: 2025-08-01 15:58
// **/
//public class ApacheCommonTest {
//
//    public class BloomFilterExample {
//        public static void main(String[] args) {
//            // 创建布隆过滤器，预计插入100个元素，误判率为0.01
//            BloomFilter<String> bloomFilter = new BloomFilter<>(HashFunctionIdentity.hashFunction(StringUtils::hashCode), 100, 0.01);
//            // 插入元素
//            bloomFilter.put("Lynn");
//            bloomFilter.put("666");
//            bloomFilter.put("八股文");
//            // 判断元素是否存在
//            System.out.println(bloomFilter.mightContain("Lynn")); // true
//            System.out.println(bloomFilter.mightContain("张三"));  // false
//        }
//    }
//}
